package cn.com.flat.modules.common.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 标题: 根控制器
 * <p>
 * 描述: 公共页面跳转控制器
 * <p>
 * 版权：Copyright (c) 2016
 * <p>
 *
 * @author 张顺
 * @created 2016/11/06/22:41
 * @version 1.0
 */
@Controller
public class RootController {


    @RequestMapping(value="/index",method = RequestMethod.GET)
    public String index()throws Exception{
        return "index";
    }

    /**
     * 跳转登录页
     * @return
     * @throws Exception
     */
    @RequestMapping(value="/login",method = RequestMethod.GET)
    public String login()throws  Exception{
        System.out.print("登录");
        return "login";
    }

    /**
     * 跳转404页面
     * @return
     */
    @RequestMapping(value="/toNotFoundError",method = RequestMethod.GET)
    public String toNotFoundError(){
        return "";
    }

    /**
     * 跳转首页
     * @return
     * @throws Exception
     */
    @RequestMapping(value="/",method = RequestMethod.GET)
    public String welcome()throws  Exception{
        return "redirect:/login";
    }
}
